<?php
/**
 * Search Criteria for Candidat search
 *
 * @author Xavier VILAIN
 * @package Hive\Ressource
 * @license
 */
use Fox\Html\Wrapper;
use Fox\Html\DropList\Confirm;
use Fox\Html\Button;
use Fox\Html\Interval;
use Fox\Html\Input;
use Fox\Html\Screen;
use Fox\Html\DropList;
use Fox\Html\Anchor;
use Fox\Dao\SqlFragment;
use Fox\Generator;
use Fox\Html\DropList\Token;
$xview = Xview::instance();

$wrapper = new Wrapper('criteria');
$blBasics = new Fox\Html\Block("bBasicCriteria");
// Filters
$blBasics->add(new Interval('kn_number_year'));
$blBasics->add(new Input('available_date',false),2);
$blBasics->add(new Interval(array('targeted_salary','targeted_total_salary')));
$blBasics->add(new Confirm('hasbeenintv',false),2);

// Status
$status = Hive\Contact\Status::loadAll();
$blBasics->add(new DropList(array('res_status','status'),true))
		->options($status,Generator::useAttribute('status'),Generator::useAttribute('label'));
$groupingDp = $xview->component('ressource','grouping',array('authorizationCheck' => false));
$groupingDp->blankSelection(true);
$blBasics->add($groupingDp,2,'status');

$blBasics->add(new Input('keyword',false))->colspan(2);
$blBasics->add(new Input('dbcnt',true,200));
$wrapper->add($blBasics);
// Advance Criteria
$blAdvCriteria = new Fox\Html\Block('bAdvanceCriteria',Msg(Hive::BUNDLE,Hive::LABEL_ADVANCE_CRITERIA));
$blAdvCriteria->collapsed(true);
$blAdvCriteria->add(new Token('localization'))
		->source(Generator::url('localization','autocomplete'))
		->formater("\\Fox\\Common\\Localization::parse");
$wrapper->add($blAdvCriteria);
return $wrapper;